<?php


namespace App\Controller;


use App\Helpers\ApiResponse;
use Hyperf\Contract\StdoutLoggerInterface;

class BaseController extends AbstractController
{
    use ApiResponse;


    /**
     * @var StdoutLoggerInterface
     */
    protected $logger;

    public function __construct(StdoutLoggerInterface $logger)
    {
        $this->logger = $logger;
    }


    /**
     * 获取上下文指定值
     * @param string $name
     * @return mixed
     */
    protected function attr($name='user'){
        return $this->request->getAttribute($name);
    }
}